import os
import sys



profile = "DEFAULT"

DEFAULT = {
    "PATH" : (os.path.abspath(os.path.dirname(os.path.realpath(__file__)))),
    "PARSER" : "McClosky",
    "SMALL_CUES" : False,
    "ON_NEGATIONS": True,
    "TRAINING" : False,
    "ML" : False,
    "CLASS" : 1,
    "MAX_DIST" : 20,
    "FORMAT" : 'CSV',
}

TRAIN1 = DEFAULT.copy()
TRAIN1.update({
    "TRAINING" : True,
    "ML" : True
})


TEST1 = DEFAULT.copy()
TEST1.update({
    "SMALL_CUES" : False,
    "ON_NEGATIONS": True,
    "TRAINING" : False,
    "ML" : True,
})

TRAIN2 = DEFAULT.copy()
TRAIN2.update({
    "TRAINING" : True,
    "ML" : True,
    "CLASS" : 2,
})


TEST2 = DEFAULT.copy()
TEST2.update({
    "SMALL_CUES" : False,
    "ON_NEGATIONS": True,
    "TRAINING" : False,
    "ML" : True,
    "CLASS" : 2,
})

TRAIN3 = DEFAULT.copy()
TRAIN3.update({
    "TRAINING" : True,
    "ML" : True,
    "CLASS" : 3,
})


TEST3 = DEFAULT.copy()
TEST3.update({
    "SMALL_CUES" : False,
    "ON_NEGATIONS": True,
    "TRAINING" : False,
    "ML" : True,
    "CLASS" : 3,
})


etypes = {
'Gene_expression': 0,
'Transcription': 1,
'Protein_catabolism': 2,
'Localization': 3,
'Phosphorylation': 4,
'Binding': 5,
'Regulation': 6,
'Positive_regulation': 7,
'Negative_regulation': 8,
}


Bikel_tags = ['', 'NAC', 'PRP$', 'VBG', 'SBAR', 'VBD', 'SINV', 'ADJP', 'WHADVP', 'VBN', 'CONJP', 'VBP', 'WDT', 'WHADJP', 'JJ', 'WP', 'VBZ', 'DT', 'FW', 'PP', 'RP', 'NN', 'UCP', 'PRN', ',', '.', 'NX', 'TO', 'LST', 'PRP', 'RB', 'NP', '-LRB-', ':', 'NNS', 'WHPP', '?', 'NNP', 'FRAG', 'VB', 'WRB', 'MD', 'CC', 'LS', 'PDT', 'RBS', 'RBR', 'CD', 'VP', 'S', 'PRT', 'IN', 'WP$', 'X', 'INTJ', 'ADVP', 'QP', 'NNPS', "'", '-RRB-', 'POS', 'SQ', 'JJS', 'JJR', 'SYM', 'WHNP', 'UH', 'EX',] 

McClosky_tags = ['', 'NAC', 'PRP$', 'VBG', 'SBAR', 'VBD', 'SINV', 'ADJP', 'S1', 'WP', 'VBN', 'POS', "''", 'INTJ', 'VBP', 'WDT', 'WHADJP', 'JJ', 'X', 'VBZ', 'DT', 'FW', 'PP', 'RP', '$', 'NN', 'WHPP', 'PRN', ',', '.', 'NX', 'TO', 'LST', 'PRP', 'RB', 'NP', '-LRB-', ':', 'NNS', 'WHADVP', 'NNP', 'FRAG', 'VB', 'WRB', 'MD', 'CC', 'LS', 'PDT', 'RBS', 'RBR', 'CD', 'VP', 'S', 'PRT', 'IN', 'WP$', 'AUX', 'CONJP', 'ADVP', 'QP', 'NNPS', 'AUXG', '-RRB-', 'SQ', 'UCP', 'JJS', 'JJR', 'SYM', 'WHNP', 'UH', 'EX']


#(WORD, START, END, IS_PROT, IS_TRIG) = range(5)
NEGATION_CUES = [
'no',
'not',
'none',
'negative',
'without',
'absence',
'fail',
'fails',
'failed',
'failure',
'cannot',
'lack',
'lacking',
'lacked',
'inactive',
'neither',
'nor',
'inhibit',
'unable',
'blocks',
'blocking',
'preventing',
'prevents',
'absent',
'never',
'unaffected',
'unchanged',
'impaired',
'little',
'independent',
'except',
'exception',
]

CLASSES = {
    1    : ('Gene_expression','Transcription','Protein_catabolism','Localization','Phosphorylation'),
    2    : ('Binding'),
    3    : ('Regulation', 'Positive_regulation', 'Negative_regulation'),
}



##########################################
# Applying the profile

if len(sys.argv) > 1:
    profile = sys.argv[1]
if profile.find('-h') != -1:
    print_help()
    sys.exit(0)

profile_dict = locals()[profile]
print profile_dict
globals().update(profile_dict)

##########################################



if TRAINING:
    directory = PATH + '/../data/bionlp09_shared_task_training_data/'
else:
    directory = PATH + '/../data/bionlp09_shared_task_development_data/'


if SMALL_CUES:
    NEGATION_CUES = NEGATION_CUES[0:14]



